Skip to content

chore(oauth2): Implement Protected Resource protocol#133

Merged
timothedelion merged 3 commits into
mainfrom
tdelion/APPAI-524/protected-resource-metadata
May 18, 2026
Merged

chore(oauth2): Implement Protected Resource protocol#133
timothedelion merged 3 commits into
mainfrom
tdelion/APPAI-524/protected-resource-metadata

Conversation

@timothedelion
Copy link
Copy Markdown
Member

@timothedelion timothedelion self-assigned this Apr 14, 2026
@linear
Copy link
Copy Markdown

linear Bot commented Apr 14, 2026

@timothedelion timothedelion force-pushed the tdelion/APPAI-524/protected-resource-metadata branch 2 times, most recently from 9ba1e2f to b381f80 Compare May 2, 2026 15:26
@timothedelion timothedelion force-pushed the tdelion/APPAI-524/protected-resource-metadata branch from b381f80 to 178ea64 Compare May 11, 2026 08:32
…odes

Both modes now read the bearer token from the request scope via
FastMCP's `get_access_token()`. `GitGuardianOAuthThinProxy.verify_token`
no longer round-trips to `/api_tokens/self` per request — a new
`PassThroughTokenVerifier` trusts the token and lets downstream calls
surface 401s. `GitGuardianAuthorizationHeaderMCP` reuses the same
verifier so the manual `Authorization` header parser is gone.

Issue: APPAI-524
@timothedelion timothedelion force-pushed the tdelion/APPAI-524/protected-resource-metadata branch from 178ea64 to 20bc4ee Compare May 12, 2026 12:13
@timothedelion timothedelion requested a review from KNedelec May 12, 2026 14:50
When `TranslateDownstreamUnauthorizedMiddleware` flips a 200 into a 401,
the response has no `WWW-Authenticate` header for the advertise middleware
to augment, so it synthesizes one. Previously it emitted only
`as_metadata` — the Claude.ai-specific shortcut — leaving spec-compliant
MCP clients (Cursor, MCP Inspector) without the standard
`resource_metadata` discovery pointer required by RFC 9728.

`resource_metadata_url_provider` is resolved lazily because FastMCP calls
`get_middleware()` before `set_mcp_path()`, so the resource URL is not
known at middleware construction time.

Issue: APPAI-524
@timothedelion timothedelion merged commit 9c68c14 into main May 18, 2026
9 checks passed
@timothedelion timothedelion requested a review from NEGU93 May 18, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant